﻿/**
 * HelpScreen.cs - Help screen  (how to play)
 * 
 * Part of BoulderDAM - A BoulderDash clone using C# and SDL
 * Nacho Cabanes & students of DAM IES San Vicente, 2014
 * 
 * Revisions
 * #     Date         Creator, changes
 * ----  -----------  -------------------------------------------------------
 * 0.01  02-apr-2014  Nacho Cabanes: Basic help screen, showing static text
 * 0.02  03-apr-2014  Pau Chorro & Saúl Sánchez: menu which will display text 
 *                        mode minigame aid in future
 * 0.03  03-apr-2014  Nacho Cabanes: Replaced recursivity with extra methods
 *                        Remove extra "ShowHiddenScreen", which caused flicker                    
 * 0.04 07-apr-2014   Jose Luis Valdelvira, Omar Marin, Luis Miguel Rubio: 
 *                        Completed help Submenu
 */


namespace Boulder
{
    class HelpScreen
    {
        private Font font18;
        //Image myPlayer;

        public HelpScreen()
        {
            font18 = new Font("data/Joystix.ttf", 18);
            //myPlayer = new Image("data/playerR01.png");
        }


        public void Run()
        {

            do
            {
                //HEADER
                Hardware.ClearScreen();
                Hardware.WriteHiddenText("HELP - BOULDER",
                    350, 100,
                    0x08, 0x6D, 0x08,
                    font18);
                Hardware.WriteHiddenText("Hit the Number to SHOW the HELP",
                    270, 140,
                    0x99, 0x99, 0x99,
                    font18);

                //MENU
                Hardware.WriteHiddenText("1- MOVE: arround the map",
                    300, 190,
                    0xCC, 0xCC, 0xCC,
                    font18);

                Hardware.WriteHiddenText("2- PUSHING: a rock",
                    300, 220,
                    0xCC, 0xCC, 0xCC,
                    font18);

                Hardware.WriteHiddenText("3- CATCHING: a mirror",
                    300, 250,
                    0xCC, 0xCC, 0xCC,
                    font18);

                if (Hardware.KeyPressed(Hardware.KEY_1))
                {
                    ShowHelpOnMoving();
                }

                if (Hardware.KeyPressed(Hardware.KEY_2))
                {
                    ShowHelpOnPushing();
                }

                if (Hardware.KeyPressed(Hardware.KEY_3))
                {
                    ShowHelpOnCatching();
                }

                //FOOTER
                Hardware.WriteHiddenText("Hit ESC to return",
                    370, 640,
                    0x99, 0x99, 0x99,
                    font18);
                Hardware.ShowHiddenScreen();

                Hardware.Pause(50);
            }
            while (!Hardware.KeyPressed(Hardware.KEY_ESC));


            //METHODS TO SHOW THE MINIGAME HELPER
            //--TO : implementing with the player class
            // Cargamos una imagen 
        }


        // MOVE: arround the map
        private void ShowHelpOnMoving()
        {
            do
            {
                Hardware.ClearScreen();
                Hardware.WriteHiddenText("HELP - MOVE",
                350, 100,
                0x08, 0x6D, 0x08,
                font18);

                //Arrow Rigth
                Hardware.WriteHiddenText("Press key -->",
                    150, 190,
                    0xCC, 0xCC, 0xCC,
                    font18);
                //Arrow Left
                Hardware.WriteHiddenText("Press key <--",
                    150, 260,
                    0xCC, 0xCC, 0xCC,
                    font18);
                //Arrow Down
                Hardware.WriteHiddenText("Press key down",
                    150, 330,
                    0xCC, 0xCC, 0xCC,
                    font18);
                //Arrow up
                Hardware.WriteHiddenText("Press key up",
                    150, 400,
                    0xCC, 0xCC, 0xCC,
                    font18);

                Hardware.WriteHiddenText("Hit ENTER to return",
                    370, 640,
                    0x99, 0x99, 0x99,
                    font18);
                Hardware.ShowHiddenScreen();
                Hardware.Pause(50);
            }
            while (!Hardware.KeyPressed(Hardware.KEY_RETURN));
        }


        //PUSHING: a rock
        private void ShowHelpOnPushing()
        {
            do
            {
                Hardware.ClearScreen();
                Hardware.WriteHiddenText("HELP - MOVE",
                350, 100,
                0x08, 0x6D, 0x08,
                font18);
                Hardware.WriteHiddenText("Hit ENTER to return",
                    370, 640,
                    0x99, 0x99, 0x99,
                    font18);
                Hardware.ShowHiddenScreen();
                Hardware.Pause(50);
            }
            while (!Hardware.KeyPressed(Hardware.KEY_RETURN));
        }


        //CATCHING: a mirror
        private void ShowHelpOnCatching()
        {
            do
            {
                Hardware.ClearScreen();
                Hardware.WriteHiddenText("HELP - MOVE",
                350, 100,
                0x08, 0x6D, 0x08,
                font18);
                Hardware.WriteHiddenText("Hit ENTER to return",
                    370, 640,
                    0x99, 0x99, 0x99,
                    font18);
                Hardware.ShowHiddenScreen();
                Hardware.Pause(50);
            }
            while (!Hardware.KeyPressed(Hardware.KEY_RETURN));
        }
    }
}
